import { getProductList, getSecondList } from '@/service/get-data'
import { GETPRODUCTLIST, GETSECONDLIST } from './mutations-types'
import { setStore } from '@/untils/storage'

export default{
  async getProductList ({ commit }, callback) {
    const res = await getProductList()
    commit(GETPRODUCTLIST, res)
    setStore('productList', res.data.data)
  },
  async getSecondList ({ commit }, callback) {
    const res = await getSecondList()
    commit(GETSECONDLIST, res)
    // callback 方法什么时候执行
  }
}
